home *** CD-ROM | disk | FTP | other *** search
- This note explains the new PLplot color model.
-
- Color map 0
- -----------
-
- This palette is intended for plotting axes, lines, labels, whatever. The
- entire palette can be changed by calling plscmap0(), and an individual
- color is selected by calling plcol0() with the index of the color.
- Maximum number of colors is currently 16.
-
- Color map 1
- -----------
-
- Used for plots in which the data value is represented by the color.
- The location in color map 1 space is specified through a floating point
- number between 0 and 1. This allows continuous tone plots to be made,
- depending on the number of colors supported by the driver.
-
- The mapping between data value and color value is made by specifying a
- number of "control points". These points have a color value (in HLS or
- RGB space) and a location in color map 1 (from 0 to 1). Between these
- points, linear interpolation is used. By mapping location in the color
- map to function value, or intensity, you can get a smooth variation of
- color. Any number of control points may be specified, located at
- arbitrary intensities, although typically 2 - 4 are enough. Another way
- of stating this is that we are traversing a given number of lines through
- HLS (or RGB) space as we move through cmap 1 entries. The control points
- at the minimum and maximum intensity (0 and 1) must always be specified.
- By adding more control points you can get more variation. One good
- technique for plotting functions that vary about some expected average is
- to use an additional 2 control points in the center (intensity ~= 0.5)
- that are the same color as the background (typically white for paper
- output, black for crt), and same hue as the boundary control points. This
- allows the highs and lows to be very easily distinguished.
-
- Each control point must specify the location in cmap 1 as well as
- three coordinates in HLS or RGB space. The first point MUST correspond
- to location = 0, and the last to location = 1.
-
- Bounds on RGB coordinates:
- R,G,B [0, 1] magnitude
-
- Bounds on HLS coordinates:
- hue [0, 360] degrees
- lightness [0, 1] magnitude
- saturation [0, 1] magnitude
-
- The inputs to plscmap1l() are:
- itype 0: RGB, 1: HLS
- npts number of control points
- location[] location for each control point
- coord1[] first coordinate for each control point
- coord2[] second coordinate for each control point
- coord3[] third coordinate for each control point
-
-
- Color map 1 has three defining constants:
-
- 1. Number of control points. You can use few (typical) or many.
-
- 2. Number of sampled RGB values. In theory, these are not needed, since
- you can determine the proper RGB value from the inverse mapping as
- specified in plscmap1l(). However, to make the inverse a simple
- lookup, I sample a limited number of colors at discrete locations in
- cmap1 space. Typically 256 are used (high enough that discreteness
- should not be a factor).
-
- 3. Maximum number of actual output colors. This is driver-dependent.
- E.g. it is 16-ncol0-1, where ncol0 is number of colors in cmap0, for
- the tek driver (subtract 1 for the background). The X driver can
- display many in principle (over 100) but I limit the number due to
- practical considerations (direct rgb, multiple plplot apps, etc).
-